package builder.AccountFormBuilderPackage;

import handler.accountFormHandlers.LoginRegisterButtonActionListener;
import handler.accountFormHandlers.LoginSubmitButtonActionListener;

import java.awt.Component;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JLabel;

import builder.FormBuilder;
import builder.FormBuilderDecorator;
import form.AccountForm.AccountForm;

public class LoginDecorator extends FormBuilderDecorator {

	public LoginDecorator(FormBuilder decoratee){
		super(decoratee);
	}
	
	
	public void setFormSettings() {
		// TODO Auto-generated method stub
		super.setFormSettings();
		
	}

	@Override
	public void buildComponents() {
		// TODO Auto-generated method stub

		AccountForm loginForm = (AccountForm) decoratee.getForm();
		
		JLabel lblHeader = new JLabel("LOGIN");
		lblHeader.setFont(new Font("Impact", Font.BOLD, 70));
		lblHeader.setAlignmentX(Component.CENTER_ALIGNMENT);
		loginForm.add(lblHeader);
		
		super.buildComponents();
		
		JButton btnSubmit = new JButton("Submit");
		btnSubmit.addActionListener(new LoginSubmitButtonActionListener(loginForm));
		btnSubmit.setAlignmentX(Component.CENTER_ALIGNMENT);
		loginForm.add(btnSubmit);
		
		JButton btnRegister = new JButton("Register");
		btnRegister.addActionListener(new LoginRegisterButtonActionListener());
		btnRegister.setAlignmentX(Component.CENTER_ALIGNMENT);
		loginForm.add(btnRegister);
	} 
	
	
	
}
